<? if(!defined('IN_FANWE')) exit('Access Denied'); ?>
<div id="newpocket">
<div class="addtext">
    	<span class="innerborder">
        	<input id="newBoardName" tabindex="1" type="text" class="deftest gray " maxlength="20" value="<?=$album['title']?>" albumname="请输入杂志社名称" name="album_name" />
            <input type="hidden" name="album_id" value="<?=$album['id']?>" id="album_id">
        </span>
    </div>
    <div class="category">
    	<h2 class="f14 b">杂志社的分类？</h2>
        <div class="list">
        	<ul class="cf" id="boardcategories"><? if(is_array($_FANWE['cache']['albums']['category'])) { foreach($_FANWE['cache']['albums']['category'] as $category) { ?>                    <input tabindex="2" type="radio" name="album_cid" value="<?=$category['id']?>" <? if($album['cid'] == $category['id']) { ?> checked="checked"<? } ?>>
                	<label class="radio f14" for="radio-0"><?=$category['name']?></label>
<? } } ?>
               </ul>
        </div>
    </div>
</div>
<div class="optionshare">
<div class="modifyborder" id="jquery-option">
<span><a href="javascript:;" class="alldel-btn delete dialogdel">删除图格</a></span>
<span style="display: none; ">确认删除图格吗？<a id="delete" href="javascript:void(0);" class="enter submitbtn confirm-btn" onclick="$.Remove_Album(<?=$album['id']?>)">确认</a> <a id="cancel" href="javascript:void(0);" class="reset submitbtn cancel-btn">取消</a></span>
</div>
</div>

<div id="createBoardBtnDiv" class="dialogsubmit" style="border-top:none;">
<a id="createBoardBtn" class="calloff bigbuttongray bigbutton" href="javascript:void(0);" tabindex="4" onClick="$.Update_User_Album(this,publishCreateAlbumRel);">确认修改</a>
    <a class="confirmback" href="javascript:;" id="jqruey-goback" style="display: none; ">确认返回</a>
</div>

<script>
jQuery(function($){
$(".deftest").live('focus',function(){
var old = this.getAttribute("albumName");
if(this.value == old)
{
this.value = '';
$(this).css('color',"#000");
}
}).live('blur',function(){
var old = this.getAttribute("albumName");
if(this.value == old || this.value == '')
{
this.value = old;
$(this).css('color',"#ccc");
}
});	

$(".delete").click(function(){
$(this).parent().hide().siblings("span").show();	
});
$("#cancel").click(function(){
$(this).parent().hide().siblings("span").show();	
});
$("#newBoardName").blur(function(){
checkButton();
});
$('input:radio[name="album_cid"]').click(function(){
checkButton();
});

});
function checkButton()
{
if($("#newBoardName").val() != '请输入杂志社名称' && $("#newBoardName").val() != '')
{
var list= $('input:radio[name="album_cid"]:checked').val();
        if(list != null){
$("#createBoardBtn").removeClass("calloff").removeClass("callon").addClass("callon");
}
}
else
{
$("#createBoardBtn").removeClass("calloff").removeClass("callon").addClass("calloff");
}
}
function publishCreateAlbumRel(result)
{
if(result.status == 1)
{
$.weeboxs.close();
location.href = result.url;
}
else
{
alert('创建杂志社失败');
}
}
</script>
